package com.lagou.rpc.consumer;

import com.lagou.rpc.consumer.client.RpcClientManger;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ClientBootstrapApplication implements DisposableBean {

    @Autowired
    private RpcClientManger rpcClientManager;

    public static void main(String[] args) {
        SpringApplication.run(ClientBootstrapApplication.class, args);
    }

    @Override
    public void destroy() throws Exception {
        rpcClientManager.close();
    }
}
